package edu.nanyang.service;

import edu.nanyang.dao.AdminInfoDao;
import edu.nanyang.domain.AdminInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AdminInfoService {
    @Resource
    private AdminInfoDao adminInfoDao;

    public AdminInfo getByNameAndPass(String adminName, String adminPass) {
        AdminInfo adminInfo = adminInfoDao.getByAdminName(adminName);
        if (null != adminInfo) {
            if (adminInfo.getAdminPass().equals(adminPass)) {
                return adminInfo;
            }
        }
        return null;
    }

    public AdminInfo getById(int id) {
        return adminInfoDao.getById(id);
    }
}